package com.lagou.edu.course.api;

import com.lagou.edu.course.api.dto.LessonDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * TODO
 *
 * @author lm
 * @since 2021/11/1 16:00
 */
@FeignClient(value = "edu-course-boot", path = "/course/lesson")
public interface LessonRemoteService {
    /**
     * 保存或者更新课程
     * @param lessonDTO
     * @return
     */
    @PostMapping(value = "/saveOrUpdate")
    boolean saveOrUpdate(@RequestBody LessonDTO lessonDTO);

    /**
     * 通过lessonId获取课时
     *
     * @param lessonId 课时ID
     * @return
     */
    @GetMapping(value = "/getById")
    LessonDTO getById(@RequestParam("lessonId") Integer lessonId);
}
